﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace GesWork.maestros
{
    public partial class contacto : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string  id= Request.QueryString["id"];
          
            if (id == null)
            {
                FormView1.ChangeMode(FormViewMode.Insert);
          
            }

           
            fvAdress.DataBind();
            if (fvAdress.DataItemCount == 0)
            {
                btnNewAddres.Visible = true;
            }
            else
            {
                btnNewAddres.Visible = false;
            }
           
        }

        protected void nuevaDireccion(object sender, ImageClickEventArgs e)
        {
            fvAdress.ChangeMode(FormViewMode.Insert);
        }

       


        //protected void btnModificar_Click(object sender, EventArgs e)
        //{
        //    FormView1.ChangeMode(FormViewMode.Edit);
        //    btnModificar.Visible = false;
        //    btnEliminar.Visible = false;

        //}

        //protected void btnEliminar_Click(object sender, EventArgs e)
        //{
        //    string id = Request.QueryString["id"];
        //    if (id != null)
        //    {
        //        SqlDataSource1.DeleteParameters["ID"].DefaultValue = id;

        //        SqlDataSource1.Delete();
        //        //SqlDataSource1.DataBind();
        //        Response.Redirect("contactos.aspx");
        //    }

        //}

      
    }
}
